package com.ruoyi.campus.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;


import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Size;
import java.math.BigDecimal;
import java.util.Date;

/**
 * 学校信息对象 school_info
 * 
 * @author campus-alarm
 * @date 2024-01-01
 */
@TableName("school_info")
public class SchoolInfo extends BaseEntity
{
    private static final long serialVersionUID = 1L;

    /** 学校ID */
    @TableId(type = IdType.AUTO)
    private Long schoolId;

    /** 学校名称 */
    @Excel(name = "学校名称")
    @NotBlank(message = "学校名称不能为空")
    @Size(min = 2, max = 100, message = "学校名称长度必须在2-100字符之间")
    private String schoolName;

    /** 学校编码 */
    @Excel(name = "学校编码")
    @Size(max = 50, message = "学校编码长度不能超过50字符")
    private String schoolCode;

    /** 学校类型：1小学 2初中 3高中 4九年一贯制 */
    @Excel(name = "学校类型", readConverterExp = "1=小学,2=初中,3=高中,4=九年一贯制")
    private Integer schoolType;

    /** 联系电话 */
    @Excel(name = "联系电话")
    @Size(max = 20, message = "联系电话长度不能超过20字符")
    private String contactPhone;

    /** 学校地址 */
    @Excel(name = "学校地址")
    private String address;

    /** 校长姓名 */
    @Excel(name = "校长姓名")
    @Size(max = 50, message = "校长姓名长度不能超过50字符")
    private String principalName;

    /** 校长电话 */
    @Excel(name = "校长电话")
    @Size(max = 20, message = "校长电话长度不能超过20字符")
    private String principalPhone;

    /** 纬度 */
    @Excel(name = "纬度")
    private BigDecimal latitude;

    /** 经度 */
    @Excel(name = "经度")
    private BigDecimal longitude;

    /** 学生总数 */
    @Excel(name = "学生总数")
    private Integer totalStudents;

    /** 教师总数 */
    @Excel(name = "教师总数")
    private Integer totalTeachers;

    /** 建校日期 */
    @Excel(name = "建校日期", width = 30, dateFormat = "yyyy-MM-dd")
    private Date establishmentDate;

    /** 状态：0停用 1启用 */
    @Excel(name = "状态", readConverterExp = "0=停用,1=启用")
    private Integer status;

    /** 学校类型名称（用于显示） */
    @TableField(exist = false)
    private String schoolTypeName;

    /** 状态名称（用于显示） */
    @TableField(exist = false)
    private String statusName;

    public String getSchoolTypeName() {
        if (schoolType == null) {
            return "";
        }
        switch (schoolType) {
            case 1:
                return "小学";
            case 2:
                return "初中";
            case 3:
                return "高中";
            case 4:
                return "九年一贯制";
            default:
                return "未知";
        }
    }

    public String getStatusName() {
        if (status == null) {
            return "";
        }
        return status == 1 ? "启用" : "停用";
    }

    public Long getSchoolId() {
        return schoolId;
    }

    public void setSchoolId(Long schoolId) {
        this.schoolId = schoolId;
    }

    public String getSchoolName() {
        return schoolName;
    }

    public void setSchoolName(String schoolName) {
        this.schoolName = schoolName;
    }

    public String getSchoolCode() {
        return schoolCode;
    }

    public void setSchoolCode(String schoolCode) {
        this.schoolCode = schoolCode;
    }

    public Integer getSchoolType() {
        return schoolType;
    }

    public void setSchoolType(Integer schoolType) {
        this.schoolType = schoolType;
    }

    public String getContactPhone() {
        return contactPhone;
    }

    public void setContactPhone(String contactPhone) {
        this.contactPhone = contactPhone;
    }

    public String getAddress() {
        return address;
    }

    public void setAddress(String address) {
        this.address = address;
    }

    public String getPrincipalName() {
        return principalName;
    }

    public void setPrincipalName(String principalName) {
        this.principalName = principalName;
    }

    public String getPrincipalPhone() {
        return principalPhone;
    }

    public void setPrincipalPhone(String principalPhone) {
        this.principalPhone = principalPhone;
    }

    public BigDecimal getLatitude() {
        return latitude;
    }

    public void setLatitude(BigDecimal latitude) {
        this.latitude = latitude;
    }

    public BigDecimal getLongitude() {
        return longitude;
    }

    public void setLongitude(BigDecimal longitude) {
        this.longitude = longitude;
    }

    public Integer getTotalStudents() {
        return totalStudents;
    }

    public void setTotalStudents(Integer totalStudents) {
        this.totalStudents = totalStudents;
    }

    public Integer getTotalTeachers() {
        return totalTeachers;
    }

    public void setTotalTeachers(Integer totalTeachers) {
        this.totalTeachers = totalTeachers;
    }

    public Date getEstablishmentDate() {
        return establishmentDate;
    }

    public void setEstablishmentDate(Date establishmentDate) {
        this.establishmentDate = establishmentDate;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public void setSchoolTypeName(String schoolTypeName) {
        this.schoolTypeName = schoolTypeName;
    }

    public void setStatusName(String statusName) {
        this.statusName = statusName;
    }
} 